#!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import TYPE_CHECKING

from sqlalchemy import Column, ForeignKey, Integer, String, text, TIMESTAMP
from sqlalchemy.orm import relationship

from app.db.base_class import Base


class Exchange(Base):
    __tablename__ = 'tb_exchange'
    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(20))
    code = Column(String(20))
    areaId = Column('area_id', Integer)
    createdDate = Column('created_date', TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'))
    updatedDate = Column('updated_date', TIMESTAMP,
                         server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))



    # platform = relationship('Platform', back_populates='instruments')

    # def __getitem__(self, item):
    #     return self.__getattribute__(item)